﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using Microsoft.Practices.Unity;

namespace PJ.Presentation.Common
{
    /*
    public abstract class ViewControl<ModelT, ViewT> : UserControl, IView
        where ModelT : IViewModel
        where ViewT : IView
    {
        public ViewControl()
        {
        }

        public ViewControl(ModelT model)
        {
            if (model == null)
                throw new ArgumentNullException();
            this.DataContext = model;
        }

        public ModelT ViewModel
        {
            get 
            {
                if (!(this.DataContext is ModelT))
                {
                    this.DataContext = PJ.Framework.Common.InjectionBroker.Resolve<ModelT>();
                }
                return (ModelT)this.DataContext;
            }
        }

        IViewModel IView.ViewModel
        {
            get { return this.ViewModel; }
        }
    }
     */
}
